package com.hmall.model;

import lombok.Data;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.math.BigDecimal;
import java.util.Date;

@Data
@Table(name = "mall_product")
public class MallProduct {
    /**
     * 商品id
     */
    @Id
    private Integer id;

    /**
     * 分类id,对应mall_category表的主键
     */
    @Column(name = "category_id")
    private Integer categoryId;

    /**
     * 商品名称
     */
    private String name;

    /**
     * 商品副标题
     */
    private String subtitle;

    /**
     * 产品主图,url相对地址
     */
    @Column(name = "main_image")
    private String mainImage;

    /**
     * 价格,单位-元保留两位小数
     */
    private BigDecimal price;

    /**
     * 库存重量 单位千克
     */
    private Integer stock;

    /**
     * 商品状态.1-在售 2-下架 3-删除
     */
    private Integer status;

    /**
     * 创建时间
     */
    @Column(name = "create_time")
    private Date createTime;

    /**
     * 更新时间
     */
    @Column(name = "update_time")
    private Date updateTime;

    @Column(name = "productNo")
    private String productno;

    @Column(name = "shopId")
    private Integer shopid;

    private BigDecimal uprice;

    @Column(name = "comment_num")
    private Integer commentNum;

    private Integer special;

    @Column(name = "search_hot")
    private Integer searchHot;

    /**
     * 是否是新品，0：不是新品，1：是新品
     */
    private Integer isnew;

    public Integer getShopId() {
        return shopId;
    }

    public void setShopId(Integer shopId) {
        this.shopId = shopId;
    }

    @Column(name = "shop_id")

    private Integer shopId;

    /**
     * 图片地址,json格式,扩展用
     */
    @Column(name = "sub_images")
    private String subImages;

    /**
     * 商品详情
     */
    private String detail;

    private String content;

    private String title;


    public Integer getShopid() {
        return shopid;
    }

    public void setShopid(Integer shopid) {
        this.shopid = shopid;
    }

    @Override
    public String toString() {
        return "MallProduct{" +
                "id=" + id +
                ", categoryId=" + categoryId +
                ", name='" + name + '\'' +
                ", subtitle='" + subtitle + '\'' +
                ", mainImage='" + mainImage + '\'' +
                ", price=" + price +
                ", stock=" + stock +
                ", status=" + status +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                ", productno='" + productno + '\'' +
                ", shopid=" + shopid +
                ", uprice=" + uprice +
                ", commentNum=" + commentNum +
                ", special=" + special +
                ", searchHot=" + searchHot +
                ", isnew=" + isnew +
                ", shopId=" + shopId +
                ", subImages='" + subImages + '\'' +
                ", detail='" + detail + '\'' +
                ", content='" + content + '\'' +
                '}';
    }
}